package com.tg.paw.ums.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.tg.paw.common.entity.BaseEntity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import lombok.NoArgsConstructor;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

/**
 * <p>
 * 角色
 * </p>
 *
 * @author Rubble
 * @since 2020-10-22
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ums_role")
@ApiModel(value="Role对象", description="角色")
public class Role extends BaseEntity {


    @ApiModelProperty(value = "主键")
    @TableId(value = "role_id", type = IdType.AUTO)
    @JsonSerialize(using= ToStringSerializer.class)
    private Long roleId;

    @ApiModelProperty(value = "名称")
    @TableField("role_name")
    private String roleName;

    @ApiModelProperty(value = "描述")
    @TableField("description")
    private String description;

    @ApiModelProperty(value = "状态: (0: 禁用; 1: 启用)")
    @TableField("status")
    private Integer status;

    @ApiModelProperty(value = "所属商户: (0:系统管理员; adminId: 商户id)")
    @TableField("owner")
    @JsonSerialize(using= ToStringSerializer.class)
    private Long owner;

    @ApiModelProperty(value = "逻辑删除: (0: 正常; 1:  删除)")
    @TableField("delete_status")
    @TableLogic
    private Integer deleteStatus;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "创建者")
    @TableField(value = "creator", fill = FieldFill.INSERT)
    private String creator;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "修改者")
    @TableField(value = "modifier", fill = FieldFill.UPDATE)
    private String modifier;


}
